﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Service.Server.Log
{
    public class LogServer<T> : ILogServer<T>
    {
        private readonly log4net.ILog _logger;

        public LogServer()
        {
            _logger = log4net.LogManager.GetLogger(typeof(T));
        }

        public void LogDebug(string message)
        {
            _logger.Debug(message);
        }

        public void LogInfo(string message)
        {
            _logger.Info(message);
        }

        public void LogWarning(string message)
        {
            _logger.Warn(message);
        }

        public void LogError(string message, Exception ex = null)
        {
            _logger.Error(message, ex);
        }

        public void LogFatal(string message, Exception ex = null)
        {
            _logger.Fatal(message, ex);
        }
    }
}
